Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

新增两个 send 方法 #599

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

bigbigc0
Copy link

ValueTask Send(ReadOnlyMemory data);
ValueTask Send(IPackageEncoder packageEncoder, TSendPackage package);
返回发送字节数

ValueTask<int> Send(ReadOnlyMemory<byte> data);
ValueTask<int> Send<TSendPackage>(IPackageEncoder<TSendPackage> packageEncoder, TSendPackage package);
返回发送字节数
@@ -20,6 +20,10 @@ public abstract class ChannelBase<TPackageInfo> : IChannel<TPackageInfo>, IChann

public abstract ValueTask SendAsync(Action<PipeWriter> write);

public abstract ValueTask<int> Send(ReadOnlyMemory<byte> buffer);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Send => SendAsync?

@@ -20,6 +20,10 @@ public abstract class ChannelBase<TPackageInfo> : IChannel<TPackageInfo>, IChann

public abstract ValueTask SendAsync(Action<PipeWriter> write);

public abstract ValueTask<int> Send(ReadOnlyMemory<byte> buffer);

public abstract ValueTask<int> Send<TPackage>(IPackageEncoder<TPackage> packageEncoder, TPackage package);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Send => SendAsync?


ValueTask<int> Send<TPackage>(IPackageEncoder<TPackage> packageEncoder, TPackage package);


Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra line?>


WritePackageWithEncoder(arrayBufferWriter, packageEncoder, package);

return await SendOverIOAsync(new ReadOnlySequence<byte>(arrayBufferWriter.WrittenMemory), CancellationToken.None);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra space.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants